import restHelper from "geoserver-helper/rest";
import wfsHelper from 'geoserver-helper/wfs'
import wpsHelper from 'geoserver-helper/wps'
import wmsHelper from 'geoserver-helper/wms'
import { Local } from "@/utils/storage";
import { geoserverConfig } from "@/config/geoserver";

//geoserver地址
const geoserverUrl = Local.get("geoserverUrl") as string || geoserverConfig.url;

export const restHelperInstance = new restHelper({
  url: `${geoserverUrl}`,
  userName: geoserverConfig.userName,
  password: geoserverConfig.password,
});

export const wpsHelperInstance = new wpsHelper(`${geoserverUrl}/geoserver/ows`)
export const wmsHelperInstance = new wmsHelper({
  url: `${geoserverUrl}/wms`,
})

export const wfsHelperInstance = new wfsHelper({
  url: `${geoserverUrl}/wfs`,
  workspace: "qhd",//这个工作空间优先级最低，如果参数中没传的话就会用它
});
